%% Crustal Thickness
figure(53)
close
figure(53)
hold on

FigureTitle = 'CrustalThickness-Trace';
set(gcf,'name',regexprep(FigureTitle,'\_*',''))
set(gcf,'name',FigureTitle)
set(gcf, 'Units', 'Inches', 'Position', [5.5417 0.4583 8.4444 12.7917], 'PaperUnits', 'Inches', 'PaperSize', [8.5, 11])


numrows=3;
numcolumns=2;

masterratios_12 ={'Th/U' 'Sm/Yb' 'Lu/Hf' 'La/Sm'};

[a,CrustalThickessIndex]=ismember('ct2_ininc(1)',ConstraintOptions);


for n = 1:4
    subaxis(numrows,numcolumns,n,'Spacing',.08,'Margin',0.02,'MarginBottom',.06,'MarginLeft',.08,'Padding',0,'PaddingLeft',0.02)
    %axis(axesMinors(n,:))
    hold on
    axis square
    box on
    
    accumulatingLegend={}; 
    
    Desired_Y=masterratios_12{n};
    [b,yyvalue] = ismember(Desired_Y,RatioLabels);
    
    
    
    for iik=1:numberModels
        
        layerplot_color_here = eval(char(layerplot_color(iik)));
        layerplot_color_here_fill = eval(char(layerplot_color_fill(iik)));
        layerplot_color_here_edge = eval(char(layerplot_color_edge(iik)));
        mymarkersize = layerplot_markersize(iik);
        layerplot_marker_here = char(layerplot_marker(iik));
        
        
        
        if any((strfind(TabNames{iik},'SM')))==1
            LegendModelcounter=1; 
            numdatapts = size(eval(sprintf('DataRatios_%s(:,%g)', TabNames{iik}, yyvalue)),1);
            layerplot_marker_here = SM_Markers;
            mymarkersizeSpecial = 3;
            
            for lll = whichPrimarySM2plot
                  if LegendModelcounter==1
                         LegOnOff = 'on';
                    else
                        LegOnOff = 'off';
                  end
                    
                mymarkersize = SM_MarkerSize(lll) ;
                groupedindicies=lll:11:numdatapts;
                
                

                plot(eval(sprintf('%s_InfoALL(groupedindicies,%d)', TabNames{iik},CrustalThickessIndex)),...
                    eval(sprintf('DataRatios_%s(groupedindicies,%g)',TabNames{iik}, yyvalue))./TraceElements4Normalization_DataRatios(yyvalue),...
                    char(layerplot_marker_here(lll)),...
                    'Color',layerplot_color_here,'MarkerFaceColor',layerplot_color_here_fill,...
                    'LineWidth',   SM_LineWidth(lll) ,'MarkerSize',mymarkersize,'handlevisibility',LegOnOff)
      
                
                LegendModelcounter=LegendModelcounter+1;
            end
               accumulatingLegend={accumulatingLegend{:} names4legend_all_sources{iik}}; 
         
            
        else
           
            
            
            plot(eval(sprintf('%s_InfoALL(:,%d)', TabNames{iik},CrustalThickessIndex)),...
                eval(sprintf('DataRatios_%s(:,%g)',TabNames{iik}, yyvalue))./TraceElements4Normalization_DataRatios(yyvalue),...
                layerplot_marker_here,...
                'Color',layerplot_color_here,'MarkerFaceColor',layerplot_color_here_fill,...
                'MarkerEdgeColor',layerplot_color_here_edge,...
                'LineWidth',layerplot_linewidth(iik) ,'MarkerSize',mymarkersize)
            
              
          accumulatingLegend={accumulatingLegend{:} names4legend_all_sources{iik}};  
          
            
        end
    end
    
    xlabel(sprintf('Crustal Thickness (km)'));
    ylabel(sprintf('%s_{%s}',RatioLabels{yyvalue}, normalizationLabel));
    
    
    ax = gca;
    ax.XAxis.MinorTick = 'on';
    increment = .01;
    ax.XAxis.MinorTickValues = ax.XLim(1):increment:ax.XLim(2);
    ax.YAxis.MinorTick = 'on';
    increment = 1;
    ax.YAxis.MinorTickValues = ax.YLim(1):increment:ax.YLim(2);
    
     
    
end




masterratios_34yy ={'Sm/Nd' 'Sm/Nd'};
masterratios_34xx ={'Lu/Hf' 'Lu/Hf'};

for n = 1:2
    subaxis(numrows,numcolumns,n+4,'Spacing',.08,'Margin',0.02,'MarginBottom',.06,'MarginLeft',.08,'Padding',0,'PaddingLeft',0.02)
    %axis(axesMinors(n,:))
    hold on
    axis square
    box on
    axis([0 1 0 .6])
    
    Desired_X=masterratios_34xx{n};
    Desired_Y=masterratios_34yy{n};
    [a,xxvalue] = ismember(Desired_X,RatioLabels);
    [b,yyvalue] = ismember(Desired_Y,RatioLabels);
    
    if n==1
        
        h1=plot(Galeetal2013_MajorTrace_DataRatios(:,xxvalue)./TraceElements4Normalization_DataRatios(xxvalue),Galeetal2013_MajorTrace_DataRatios(:,yyvalue)./TraceElements4Normalization_DataRatios(yyvalue)...
            ,'o','Color',grey8,'LineWidth',0.1,'MarkerSize',4,'MarkerFaceColor',grey8);
        
        h2=plot(Galeetal2013_MajorTrace_DataRatios(emorbs1,xxvalue)./TraceElements4Normalization_DataRatios(xxvalue),Galeetal2013_MajorTrace_DataRatios(emorbs1,yyvalue)./TraceElements4Normalization_DataRatios(yyvalue)...
            ,'o','Color',grey5,'LineWidth',0.1,'MarkerSize',4,'MarkerFaceColor',grey5);

    end
    
    
    
    
    
    
    if n==2
        
        h1=plot((DataRatios_TraceDMM(xxvalue) - Galeetal2013_MajorTrace_DataRatios(:,xxvalue))./DataRatios_TraceDMM(xxvalue),...
            (DataRatios_TraceDMM(yyvalue) - Galeetal2013_MajorTrace_DataRatios(:,yyvalue))./DataRatios_TraceDMM(yyvalue),...
            'o','Color',grey8,'LineWidth',0.1,'MarkerSize',4,'MarkerFaceColor',grey8);
        
        h2=plot((DataRatios_TraceDMM(xxvalue) - Galeetal2013_MajorTrace_DataRatios(emorbs1,xxvalue))./DataRatios_TraceDMM(xxvalue),...
            (DataRatios_TraceDMM(yyvalue) - Galeetal2013_MajorTrace_DataRatios(emorbs1,yyvalue))./DataRatios_TraceDMM(yyvalue),...
            'o','Color',grey5,'LineWidth',0.1,'MarkerSize',4,'MarkerFaceColor',grey5);
        
    end
    
    
    
    
    for iik=1:numberModels
        
        layerplot_color_here = eval(char(layerplot_color(iik)));
        layerplot_color_here_fill = eval(char(layerplot_color_fill(iik)));
        layerplot_color_here_edge = eval(char(layerplot_color_edge(iik)));
        mymarkersize = layerplot_markersize(iik);
        layerplot_marker_here = char(layerplot_marker(iik));
        
        
        if any((strfind(TabNames{iik},'SM')))==1
            
            numdatapts = size(eval(sprintf('DataRatios_%s(:,%g)', TabNames{iik}, yyvalue)),1);
            layerplot_marker_here = SM_Markers;
            mymarkersizeSpecial = 3;
            
            for lll = whichPrimarySM2plot
                  
                mymarkersize = SM_MarkerSize(lll) ;
                groupedindicies=lll:11:numdatapts;
                
                if n == 1
                    plot(eval(sprintf('DataRatios_%s(groupedindicies,%g)',TabNames{iik}, xxvalue))./TraceElements4Normalization_DataRatios(xxvalue),...
                        eval(sprintf('DataRatios_%s(groupedindicies,%g)',TabNames{iik}, yyvalue))./TraceElements4Normalization_DataRatios(yyvalue),...
                        char(layerplot_marker_here(lll)),...
                        'Color',layerplot_color_here,'MarkerFaceColor',layerplot_color_here_fill,'LineWidth',SM_LineWidth(lll) ,'MarkerSize',mymarkersize)
                    
                else
                    
                    
                    plot((DataRatios_TraceDMM(xxvalue) - eval(sprintf('DataRatios_%s(groupedindicies,%g)',TabNames{iik}, xxvalue)))./DataRatios_TraceDMM(xxvalue),...
                        (DataRatios_TraceDMM(yyvalue) - eval(sprintf('DataRatios_%s(groupedindicies,%g)',TabNames{iik}, yyvalue)))./DataRatios_TraceDMM(yyvalue),...
                        char(layerplot_marker_here(lll)),...
                        'Color',layerplot_color_here,'MarkerFaceColor',layerplot_color_here_fill,'LineWidth',SM_LineWidth(lll) ,'MarkerSize',mymarkersize)
                    
                    
                end
                
            end
        else
           
            
            if n == 1
                plot(eval(sprintf('DataRatios_%s(:,%g)',TabNames{iik}, xxvalue))./TraceElements4Normalization_DataRatios(xxvalue),...
                    eval(sprintf('DataRatios_%s(:,%g)',TabNames{iik}, yyvalue))./TraceElements4Normalization_DataRatios(yyvalue),...
                    layerplot_marker_here,...
                    'Color',layerplot_color_here,'MarkerFaceColor',layerplot_color_here_fill,...
                    'MarkerEdgeColor',layerplot_color_here_edge,...
                    'LineWidth', layerplot_linewidth(iik)    ,'MarkerSize',mymarkersize)
                
            else
                
                
                plot((DataRatios_TraceDMM(xxvalue) - eval(sprintf('DataRatios_%s(:,%g)',TabNames{iik}, xxvalue)))./DataRatios_TraceDMM(xxvalue),...
                    (DataRatios_TraceDMM(yyvalue) - eval(sprintf('DataRatios_%s(:,%g)',TabNames{iik}, yyvalue)))./DataRatios_TraceDMM(yyvalue),...
                    layerplot_marker_here,...
                    'Color',layerplot_color_here,'MarkerFaceColor',layerplot_color_here_fill,...
                    'MarkerEdgeColor',layerplot_color_here_edge,...
                    'LineWidth', layerplot_linewidth(iik)    ,'MarkerSize',mymarkersize)
                
                
            end
            
            
            
        end
    end
    
    
    xlabel(sprintf('%s_{%s}',RatioLabels{xxvalue}, normalizationLabel));
    ylabel(sprintf('%s_{%s}',RatioLabels{yyvalue}, normalizationLabel));
    
    ax = gca;
    ax.XAxis.MinorTick = 'on';
    increment = .01;
    ax.XAxis.MinorTickValues = ax.XLim(1):increment:ax.XLim(2);
    ax.YAxis.MinorTick = 'on';
    increment = findBestIncrement( ax.YLim(2)- ax.YLim(1),ax.YAxis.TickValues(2) -  ax.YAxis.TickValues(1));
    ax.YAxis.MinorTickValues = ax.YLim(1):increment:ax.YLim(2);
    
    
    if n==1
        Data_GALE_colors = {'grey4','grey55','black'};
        
        for i = 1:size(Galeetal2013_Avg,1)
            plot(Galeetal2013_Avg_DataRatios(i,xxvalue)./TraceElements4Normalization_DataRatios(xxvalue),...
                Galeetal2013_Avg_DataRatios(i,yyvalue)./TraceElements4Normalization_DataRatios(yyvalue),...
                'xk','LineWidth',3,'MarkerSize',15, 'Color',eval(Data_GALE_colors{i}),'MarkerFaceColor',eval(Data_GALE_colors{i}));
       end
        
        
    end
    
    if n ==2
        
        for i = 1:size(Galeetal2013_Avg_DataRatios,1)
            plot((DataRatios_TraceDMM(xxvalue) - Galeetal2013_Avg_DataRatios(i,xxvalue))./DataRatios_TraceDMM(xxvalue),...
                (DataRatios_TraceDMM(yyvalue) - Galeetal2013_Avg_DataRatios(i,yyvalue))./DataRatios_TraceDMM(yyvalue),...
                'xk','LineWidth',3,'MarkerSize',15, 'Color',eval(Data_GALE_colors{i}),'MarkerFaceColor',eval(Data_GALE_colors{i}));
        end
    end
    
    
    
    
    %                 if logon ==1
    %                     set(gca,'yscale','log')
    %                     %set(gca,'xscale','log')
    %                 end
    
    
end


hold on
subaxis(3,2,1)
hold on
%axis([0 11 .6 .8])
ax = gca;
set(gca, 'Xtick',[0:1:11])
ax.XAxis.MinorTick = 'on';
increment = .5;
ax.XAxis.MinorTickValues = ax.XLim(1):increment:ax.XLim(2);
%set(gca,'Ytick',[0:.05:1])
ax.YAxis.MinorTick = 'on';
increment = .1;
ax.YAxis.MinorTickValues = ax.YLim(1):increment:ax.YLim(2);

errorbar(6.5, 0.775, .456, .456, 1, 1,'LineWidth',5,'Color','k')




%             ylabel(sprintf('%s_{%s}',RatioLabels{1}, normalizationLabel));
%             yline(0.775,'k-','N-MORB','LineWidth',2);
%             yline(0.63,'k-','DMM','LineWidth',2);
%                         xline(6.5,'k-','LineWidth',2);
%             xline(5.5,'k-','LineWidth',1);
%             xline(7.5,'k-','LineWidth',1);
%             yline(1,'k:','PUM','LineWidth',2);

subaxis(3,2,2)
hold on
%axis([0 11 .6 1.4])
set(gca, 'Xtick',[0:1:11])
%set(gca,'Ytick',[0.5:.1:2])

ax = gca;
ax.XAxis.MinorTick = 'on';
increment = .5;
ax.XAxis.MinorTickValues = ax.XLim(1):increment:ax.XLim(2);

ax.YAxis.MinorTick = 'on';
increment = .5;
ax.YAxis.MinorTickValues = ax.YLim(1):increment:ax.YLim(2);

errorbar(6.5, 1.153, .044, .044, 1, 1,'LineWidth',5,'Color','k')

accumulatingLegend={accumulatingLegend{:} 'average MORB'};

hleg=legend(accumulatingLegend,'Location','Best','autoupdate','off');
set(hleg,'FontSize',9)
            
%             ylabel(sprintf('%s_{%s}',RatioLabels{11}, normalizationLabel));
%             yline(1.152,'k-','N-MORB','LineWidth',2);
%             yline(0.71,'k-','DMM','LineWidth',2);
%             xline(6.5,'k-','LineWidth',2);
%             xline(5.5,'k-','LineWidth',1);
%             xline(7.5,'k-','LineWidth',1);
%              yline(1,'k:','PUM','LineWidth',2);

yline(0.71,'k-','WHDMM','LineWidth',2,'Color','k','FontName','Times New Roman');
yline(0.668,'k-','LineWidth',1,'Color','k');
yline(0.744,'k-','LineWidth',1,'Color','k');


yline(0.937,'k:','MK91','LineWidth',1,'Color','k','FontName','Times New Roman');
yline(0.798,'k:','HS96','LineWidth',1,'Color','k','FontName','Times New Roman');
yline(0.851,'k-','This Study','LineWidth',3,'Color','k','FontName','Times New Roman');





subaxis(3,2,3)
hold on
axis([0 11 0 4])
ax = gca;
errorbar(6.5,0.813, .011, .011, 1, 1,'LineWidth',5,'Color','k')

set(gca, 'Xtick',[0:1:11])
%set(gca,'Ytick',[0.5:.1:2])

ax = gca;
ax.XAxis.MinorTick = 'on';
increment = .5;
ax.XAxis.MinorTickValues = ax.XLim(1):increment:ax.XLim(2);

ax.YAxis.MinorTick = 'on';
increment = 1;
ax.YAxis.MinorTickValues = ax.YLim(1):increment:ax.YLim(2);


%             yline(1,'k:','PUM','LineWidth',2);
%             yline(0.82,'k-','N-MORB','LineWidth',2);
%             yline(1.5,'k-','DMM','LineWidth',2);
%
%             xline(6.5,'k-','LineWidth',2);
%             xline(5.5,'k-','LineWidth',1);
%             xline(7.5,'k-','LineWidth',1);
%             yline(1,'k:','PUM','LineWidth',2);


yline(1.53,'k-','WHDMM','LineWidth',2,'Color','k','FontName','Times New Roman');
yline(1.46,'k-','LineWidth',1,'Color','k','FontName','Times New Roman');
yline(1.65,'k-','LineWidth',1,'Color','k','FontName','Times New Roman');


yline(1.03,'k:','MK91','LineWidth',1,'Color','k','FontName','Times New Roman');
yline(1.28,'k-','HS96,This Study','LineWidth',3,'Color','k','FontName','Times New Roman');
yline(1.18,'k:','CBT01','LineWidth',1,'Color','k','FontName','Times New Roman');




subaxis(3,2,4)
hold on
%axis([0 .15 1 4])
%axis([0 11 .45 .9])
errorbar(6.5,0.753, .124, .124, 1, 1,'LineWidth',5,'Color','k')
ax = gca;
set(gca, 'Xtick',[0:1:11])
%set(gca,'Ytick',[0.45:.05:.9])

ax = gca;
ax.XAxis.MinorTick = 'on';
increment = .5;
ax.XAxis.MinorTickValues = ax.XLim(1):increment:ax.XLim(2);

ax.YAxis.MinorTick = 'on';
increment = .5;
ax.YAxis.MinorTickValues = ax.YLim(1):increment:ax.YLim(2);




%             yline(0.59,'k-','N-MORB','LineWidth',2);
%             yline(0.5,'k-','DMM','LineWidth',2);
%
%                         xline(6.5,'k-','LineWidth',2);
%             xline(5.5,'k-','LineWidth',1);
%             xline(7.5,'k-','LineWidth',1);
%             yline(1,'k:','PUM','LineWidth',2);


yline(0.503,'k-','WHDMM','LineWidth',2,'Color','k','FontName','Times New Roman');
yline(0.45,'k-','LineWidth',1,'Color','k','FontName','Times New Roman');
yline(0.54,'k-','LineWidth',1,'Color','k','FontName','Times New Roman');

yline(0.43,'k:','MK91','LineWidth',1,'Color','k','FontName','Times New Roman');
yline(0.62,'k-','This Study','LineWidth',3,'Color','k','FontName','Times New Roman');
%yline(1.18,'k:','CBT01','LineWidth',1,'Color','k','FontName','Times New Roman');





subaxis(3,2,5)
hold on
errorbar(0.813,1.004, .018, .018, .011, .011,'LineWidth',5,'Color','k')
axis([0 2.5 .4 2])
%set(gca, 'Xtick',[0.1:.2:2])
%set(gca,'Ytick',[0.5:.1:2])
ax = gca;
ax.XAxis.MinorTick = 'on';
increment = .1;
ax.XAxis.MinorTickValues = ax.XLim(1):increment:ax.XLim(2);

ax.YAxis.MinorTick = 'on';
increment = .1;
ax.YAxis.MinorTickValues = ax.YLim(1):increment:ax.YLim(2);



%             xline(1,'k:','PUM','LineWidth',2);
%             xline(0.82,'k-','N-MORB','LineWidth',2);
%             xline(1.548,'k-','DMM','LineWidth',2);
%
%             yline(1,'k:','PUM','LineWidth',2);
%             yline(1,'k-','N-MORB','LineWidth',2);
%             yline(1.3,'k-','DMM','LineWidth',2);


xline(1.53,'k-','WHDMM','LineWidth',2,'Color','k','FontName','Times New Roman');
xline(1.46,'k-','LineWidth',1,'Color','k','FontName','Times New Roman');
xline(1.65,'k-','LineWidth',1,'Color','k','FontName','Times New Roman');
xline(1.03,'k:','MK91','LineWidth',1,'Color','k','FontName','Times New Roman');
xline(1.28,'k-','HS96,This Study','LineWidth',3,'Color','k','FontName','Times New Roman');
xline(1.18,'k:','CBT01','LineWidth',1,'Color','k','FontName','Times New Roman');


yline(1.27,'k-','WHDMM','LineWidth',2,'Color','k','FontName','Times New Roman');
yline(1.22,'k-','LineWidth',1,'Color','k','FontName','Times New Roman');
yline(1.32,'k-','LineWidth',1,'Color','k','FontName','Times New Roman');
yline(1.21,'k:','HS96','LineWidth',1,'Color','k','FontName','Times New Roman');
yline(1.13,'k-','MK91, CBT01, This Study','LineWidth',3,'Color','k','FontName','Times New Roman');




subaxis(3,2,6)
hold on
axis([0 1 0 .6])
xlabel(sprintf('%s %s_{%s}','\delta',RatioLabels{xxvalue}, normalizationLabel));
ylabel(sprintf('%s %s_{%s}','\delta',RatioLabels{yyvalue}, normalizationLabel));
ax = gca;
%set(gca,'Xtick',[0:.2:1])
ax.XAxis.MinorTick = 'on';
increment = .1;
ax.XAxis.MinorTickValues = ax.XLim(1):increment:ax.XLim(2);

%set(gca,'Ytick',[0:.1:1])
ax.YAxis.MinorTick = 'on';
increment = .1;
ax.YAxis.MinorTickValues = ax.YLim(1):increment:ax.YLim(2);


for kk=1:numrows.*numcolumns
    subaxis(numrows,numcolumns,kk)
    hold on
    ax=gca;
    set(gca,'ticklength',1.5*[0.0300    0.0500])
    set(gca,'fontsize', 15,'LineWidth',0.7,'FontName','Times New Roman')
    %set(gca,'yscale','log')
    ax.YAxis.MinorTick = 'on';
    %                ax.YAxis.MinorTickValues = [0.001:0.001:.01 .02:.01:.1 .2:.1:1 2:1:10 20:10:100];
    %                 curtick = get(gca, 'XTick');
    %                 set(gca, 'XTickLabel', cellstr(num2str(curtick(:))));
    %                 curtick = get(gca, 'YTick');
    %    set(gca, 'YTickLabel', cellstr(num2str(curtick(:))));
    set(gca,'XColor', 'k')
    set(gca,'YColor', 'k')
end



%%
figure(54)
close
figure(54)
hold on
FigureTitle = 'CrustalThickness-2panel';
set(gcf,'name',regexprep(FigureTitle,'\_*',''))
set(gcf,'name',FigureTitle)

logon=1;
hold on

numrows=1;
numcolumns=2;

[a,xxxvalue]=ismember('Lnexp_cumulative',ConstraintOptions);
[a,SMvalue]=ismember('FN or FP',ConstraintOptions);
[a,CrustalThickessIndex]=ismember('ct2_ininc(1)',ConstraintOptions);


set(gcf, 'Units', 'Inches', 'Position', [7.1667 6.6528 10.9722 6.3194],  'PaperSize', [8.5, 11])
hold on

masterratios= {'Th/U' 'Sm/Yb'};

for n = 1:numrows.*numcolumns
    subaxis(numrows,numcolumns,n,'Spacing',.08,'Margin',0.02,'MarginBottom',.06,'MarginLeft',.08,'Padding',0,'PaddingLeft',0.02)
    %axis(axesMinors(n,:))
    hold on
    axis square
    
    accumulatingLegend={}; 

    
     Desired_Y=masterratios{n};
    [b,yyvalue] = ismember(Desired_Y,RatioLabels);
    
    
    xlabel(sprintf('Crustal Thickness (km)'));
    ylabel(sprintf('%s_{%s}',RatioLabels{11}, normalizationLabel));
    if n ==1
        ylabel(sprintf('%s_{%s}',RatioLabels{1}, normalizationLabel));
        
    end
    
    
    for iik=1:numberModels
        
        layerplot_color_here = eval(char(layerplot_color(iik)));
        layerplot_color_here_fill = eval(char(layerplot_color_fill(iik)));
        layerplot_color_here_edge = eval(char(layerplot_color_edge(iik)));
        mymarkersize = layerplot_markersize(iik);
        layerplot_marker_here = char(layerplot_marker(iik)); 
        
        
        
        
        if any((strfind(TabNames{iik},'SM')))==1
            LegendModelcounter=1; 
            numdatapts = size(eval(sprintf('DataRatios_%s(:,%g)', TabNames{iik}, yyvalue)),1);
            layerplot_marker_here = SM_Markers;
            mymarkersizeSpecial = 3;
            
            for lll =whichPrimarySM2plot
                groupedindicies=lll:11:numdatapts;
                mymarkersize = SM_MarkerSize(lll) ;
                  if LegendModelcounter==1
                         LegOnOff = 'on';
                    else
                        LegOnOff = 'off';
                    end
                
                plot(eval(sprintf('%s_InfoALL(groupedindicies,%d)', TabNames{iik},CrustalThickessIndex)),...
                    eval(sprintf('DataRatios_%s(groupedindicies,%g)',TabNames{iik}, yyvalue))./TraceElements4Normalization_DataRatios(yyvalue),...
                    char(layerplot_marker_here(lll)),...
                    'Color',layerplot_color_here,'MarkerFaceColor',layerplot_color_here_fill,...
                    'LineWidth',SM_LineWidth(lll),'MarkerSize',mymarkersize ,'handlevisibility',LegOnOff)
                
                
                LegendModelcounter=LegendModelcounter+1;
        
            end
             accumulatingLegend={accumulatingLegend{:} names4legend_all_sources{iik}}; 
         
        else
           
            
            
            plot(eval(sprintf('%s_InfoALL(:,%d)', TabNames{iik},CrustalThickessIndex)),...
                eval(sprintf('DataRatios_%s(:,%g)', TabNames{iik}, yyvalue))./TraceElements4Normalization_DataRatios(yyvalue),...
                layerplot_marker_here,...
                'Color',layerplot_color_here,'MarkerFaceColor',layerplot_color_here_fill,...
                'MarkerEdgeColor',layerplot_color_here_edge,...
                'LineWidth',layerplot_linewidth(iik)  ,'MarkerSize',mymarkersize)
            
             accumulatingLegend={accumulatingLegend{:} names4legend_all_sources{iik}}; 
         
            
        end
    end
    
    
    
    if logon ==1
        set(gca,'yscale','log')
        %set(gca,'xscale','log')
    end
    
    if n==2
        hleg=legend(accumulatingLegend,'Location','Best','autoupdate','off');
        set(hleg,'FontSize',11)
    end
    
end

hold on
subaxis(1,2,1)
hold on
axis([0 11 .2 2])
ax = gca;
set(gca, 'Xtick',[0:1:10])
set(gca,'Ytick',[.2 .5 1 1.3 2 3])
ax.XAxis.MinorTick = 'on';
increment = .5;
ax.XAxis.MinorTickValues = ax.XLim(1):increment:ax.XLim(2);
ax.YAxis.MinorTick = 'on';
increment = findBestIncrement( ax.YLim(2)- ax.YLim(1),ax.YAxis.TickValues(2) -  ax.YAxis.TickValues(1));
ax.YAxis.MinorTickValues = ax.YLim(1):increment:ax.YLim(2);
ylabel(sprintf('%s_{%s}',RatioLabels{1}, normalizationLabel));
yline(1.34,'k:','MORB','LabelHorizontalAlignment','right');
yline(0.904,'k:');
yline(0.775,'k:');
yline(0.724,'k:');
yline(0.256,'k:');

subaxis(1,2,2)
hold on
axis([0 10 .5 11])
set(gca, 'Xtick',[0:1:10])
set(gca,'Ytick',[.1 .5 1 10])
set(gca, 'Ytick',[.01 .1 .2 .5 1 1.3 2 3 10])
ax = gca;
ax.XAxis.MinorTick = 'on';
increment = .5;
ax.XAxis.MinorTickValues = ax.XLim(1):increment:ax.XLim(2);
ax.YAxis.MinorTick = 'on';
increment = findBestIncrement( ax.YLim(2)- ax.YLim(1),ax.YAxis.TickValues(2) -  ax.YAxis.TickValues(1));
ax.YAxis.MinorTickValues = ax.YLim(1):increment:ax.YLim(2);
ylabel(sprintf('%s_{%s}',RatioLabels{11}, normalizationLabel));
yline(4.3,'k:','MORB','LabelHorizontalAlignment','right');
yline(1.56,'k:');
yline(1.152,'k:');
yline(1.09,'k:');
yline(0.58,'k:');


for kk=1:numrows.*numcolumns
    subaxis(numrows,numcolumns,kk)
    hold on
    ax=gca;
    set(gca,'ticklength',1.5*[0.0300    0.0500])
    set(gca,'fontsize', 18,'LineWidth',.7,'FontName','Times New Roman')
    set(gca,'yscale','log')
    ax.YAxis.MinorTick = 'on';
    ax.YAxis.MinorTickValues = [0.001:0.001:.01 .02:.01:.1 .2:.1:1 2:1:10 20:10:100];
    curtick = get(gca, 'XTick');
    set(gca, 'XTickLabel', cellstr(num2str(curtick(:))));
    curtick = get(gca, 'YTick');
    set(gca, 'YTickLabel', cellstr(num2str(curtick(:))));
    set(gca,'XColor', 'k')
    set(gca,'YColor', 'k')
end


%%
figure(55)
close
figure(55)
hold on
FigureTitle = 'CrustalThickness-Useries';
set(gcf,'name',regexprep(FigureTitle,'\_*',''))
set(gcf,'name',FigureTitle)


hold on

numrows=1;
numcolumns=2;

[a,xxxvalue]=ismember('Lnexp_cumulative',ConstraintOptions);
[a,SMvalue]=ismember('FN or FP',ConstraintOptions);
[a,CrustalThickessIndex]=ismember('ct2_ininc(1)',ConstraintOptions);


set(gcf, 'Units', 'Inches', 'Position', [7.1667 6.6528 10.9722 6.3194],  'PaperSize', [8.5, 11])
hold on


for n = 1:numrows.*numcolumns
    subaxis(numrows,numcolumns,n,'Spacing',.08,'Margin',0.02,'MarginBottom',.06,'MarginLeft',.08,'Padding',0,'PaddingLeft',0.02)
    %axis(axesMinors(n,:))
    hold on
    axis square
    
    accumulatingLegend={}; 
    xxvalue = masterratios(n);
    yyvalue = masterratios(n);
    
    xlabel(sprintf('Crustal Thickness (km)'));
    ylabel('(^{230}Th/^{238}U)');
    
    
    
    for iik=1:numberModels
        
        layerplot_color_here = eval(char(layerplot_color(iik)));
        layerplot_color_here_fill = eval(char(layerplot_color_fill(iik)));
        layerplot_color_here_edge = eval(char(layerplot_color_edge(iik)));
        mymarkersize = layerplot_markersize(iik);
        layerplot_marker_here = char(layerplot_marker(iik));
        

        if any((strfind(TabNames{iik},'SM')))==1
            LegendModelcounter=1; 
            numdatapts = size(eval(sprintf('DataRatios_%s(:,%g)', TabNames{iik}, 1)),1);
            layerplot_marker_here = SM_Markers;
            mymarkersizeSpecial = 3;
            
            for lll =whichPrimarySM2plot
                groupedindicies=lll:11:numdatapts;
                mymarkersize = SM_MarkerSize(lll) ;
                  if LegendModelcounter==1
                         LegOnOff = 'on';
                    else
                        LegOnOff = 'off';
                    end
                
                if n == 1
                    
                    plot(eval(sprintf('%s_InfoALL(groupedindicies,%d)', TabNames{iik},CrustalThickessIndex)),...
                        eval(sprintf('%s_DISEQ(groupedindicies,1)', TabNames{iik})),...
                        char(layerplot_marker_here(lll)),...
                        'Color',layerplot_color_here,'MarkerFaceColor',layerplot_color_here_fill,...
                        'MarkerEdgeColor',layerplot_color_here_edge,...
                        'LineWidth',SM_LineWidth(lll),'MarkerSize',mymarkersize, 'handlevisibility',LegOnOff)
                    
                    title('Zero Ingrowth')
                    
                    
                else
                    plot(eval(sprintf('%s_InfoALL(groupedindicies,%d)', TabNames{iik},CrustalThickessIndex)),...
                        eval(sprintf('%s_DISEQ(groupedindicies,3)', TabNames{iik})),...
                        char(layerplot_marker_here(lll)),...
                        'Color',layerplot_color_here,'MarkerFaceColor',layerplot_color_here_fill,...
                        'MarkerEdgeColor',layerplot_color_here_edge,...
                        'LineWidth',SM_LineWidth(lll),'MarkerSize',mymarkersize, 'handlevisibility',LegOnOff)
                    
                    title('Complete Ingrowth','FontSize',8)
                end
         LegendModelcounter=LegendModelcounter+1;
            end
             accumulatingLegend={accumulatingLegend{:} names4legend_all_sources{iik}}; 
         
        else
           
            
            if n == 1
                plot(eval(sprintf('%s_InfoALL(:,%d)', TabNames{iik},CrustalThickessIndex)),...
                    eval(sprintf('%s_DISEQ(:,1)', TabNames{iik})),...
                    layerplot_marker_here,...
                    'Color',layerplot_color_here,'MarkerFaceColor',layerplot_color_here_fill,...
                    'MarkerEdgeColor',layerplot_color_here_edge,...
                    'LineWidth', layerplot_linewidth(iik) ,'MarkerSize',mymarkersize)
                
            else
                plot(eval(sprintf('%s_InfoALL(:,%d)', TabNames{iik},CrustalThickessIndex)),...
                    eval(sprintf('%s_DISEQ(:,3)', TabNames{iik})),...
                    layerplot_marker_here,...
                    'Color',layerplot_color_here,'MarkerFaceColor',layerplot_color_here_fill,...
                    'MarkerEdgeColor',layerplot_color_here_edge,...
                    'LineWidth', layerplot_linewidth(iik) ,'MarkerSize',mymarkersize)
                
            end
            
             accumulatingLegend={accumulatingLegend{:} names4legend_all_sources{iik}}; 
         
            
            
        end
    end
    
                  if n==2
            hleg=legend(accumulatingLegend,'autoupdate','off');
            set(hleg,'FontSize',10)
        end
          
    
    %     if logon ==1
    %         set(gca,'yscale','log')
    %         %set(gca,'xscale','log')
    %     end
    %
end



hold on
subaxis(1,2,1)
hold on
axis([0 11 0 2])
ax = gca;
set(gca, 'Xtick',[0:1:10])
set(gca,'Ytick',[0:.2:2])
ax.XAxis.MinorTick = 'on';
increment = .5;
ax.XAxis.MinorTickValues = ax.XLim(1):increment:ax.XLim(2);
ax.YAxis.MinorTick = 'on';
increment = findBestIncrement( ax.YLim(2)- ax.YLim(1),ax.YAxis.TickValues(2) -  ax.YAxis.TickValues(1));
ax.YAxis.MinorTickValues = ax.YLim(1):.1:ax.YLim(2);


subaxis(1,2,2)
hold on
axis([0 11 0 2])
set(gca, 'Xtick',[0:1:10])
set(gca,'Ytick',[0:.2:2])
ax = gca;
ax.XAxis.MinorTick = 'on';
increment = .5;
ax.XAxis.MinorTickValues = ax.XLim(1):increment:ax.XLim(2);
ax.YAxis.MinorTick = 'on';
increment = findBestIncrement( ax.YLim(2)- ax.YLim(1),ax.YAxis.TickValues(2) -  ax.YAxis.TickValues(1));
ax.YAxis.MinorTickValues = ax.YLim(1):.1:ax.YLim(2);


for kk=1:numrows.*numcolumns
    subaxis(numrows,numcolumns,kk)
    hold on
    ax=gca;
    set(gca,'ticklength',1.5*[0.0300    0.0500])
    set(gca,'fontsize', 18,'LineWidth',.7,'FontName','Times New Roman')
    %     ax.YAxis.MinorTick = 'on';
    %     ax.YAxis.MinorTickValues = [0.001:0.001:.01 .02:.01:.1 .2:.1:1 2:1:10 20:10:100];
    curtick = get(gca, 'XTick');
    set(gca, 'XTickLabel', cellstr(num2str(curtick(:))));
    curtick = get(gca, 'YTick');
    set(gca, 'YTickLabel', cellstr(num2str(curtick(:))));
    set(gca,'XColor', 'k')
    set(gca,'YColor', 'k')
end



%%

figure(60)
close
figure(60)
hold on
numrows=1;
numcolumns=2;
FigureTitle = '2Panel_SpreadingRate';
set(gcf,'name',regexprep(FigureTitle,'\_*','-'))

set(gcf, 'Units', 'Inches', 'Position', [7.1667 6.6528 10.9722 6.3194],  'PaperSize', [8.5, 11])
hold on
masterratios = {'Th/U' 'Sm/Yb'};

for n = 1:numrows.*numcolumns
    subaxis(numrows,numcolumns,n,'Spacing',.08,'Margin',0.02,'MarginBottom',.06,'MarginLeft',.08,'Padding',0,'PaddingLeft',0.02)
    %axis(axesMinors(n,:))
    hold on
    axis square
    box on
    accumulatingLegend={}; 
    

    
        Desired_Y=masterratios{n};
    [b,yyvalue] = ismember(Desired_Y,RatioLabels);
 
    
    xlabel(sprintf('Half spreading rate (cm/yr)'));
    ylabel(sprintf('%s_{%s}',Desired_Y, normalizationLabel));
    
    
   h1=plot(Galeetal2013_MajorTrace_SPREADINGRATE./20,...
       Galeetal2013_MajorTrace_DataRatios(:,yyvalue)./TraceElements4Normalization_DataRatios(yyvalue)...
        ,'o','Color',grey8,'LineWidth',0.1,'MarkerSize',5,'MarkerFaceColor',grey8);
    
    h2=plot(Galeetal2013_MajorTrace_SPREADINGRATE(emorbs1)./20,Galeetal2013_MajorTrace_DataRatios(emorbs1,yyvalue)./TraceElements4Normalization_DataRatios(yyvalue)...
        ,'o','Color',grey5,'LineWidth',0.1,'MarkerSize',5,'MarkerFaceColor',grey5);
    
    accumulatingLegend={accumulatingLegend{:} 'all MORB' 'E-MORB'};
     
    
    for iik=1:numberModels
        
        layerplot_color_here = eval(char(layerplot_color(iik)));
        layerplot_color_here_fill = eval(char(layerplot_color_fill(iik)));
        layerplot_color_here_edge = eval(char(layerplot_color_edge(iik)));
        mymarkersize = layerplot_markersize(iik);
        layerplot_marker_here = char(layerplot_marker(iik));
        
        
        
        if any((strfind(TabNames{iik},'SM')))==1
            
            LegendModelcounter=1; 
            
            numdatapts = size(eval(sprintf('DataRatios_%s(:,%g)', TabNames{iik}, yyvalue)),1);
            layerplot_marker_here = SM_Markers;
            %layerplot_ marker_here = layerplot_marker;
            mymarkersizeSpecial = 3;%mymarkersize;       %specialMarkersSizes;
            
            for lll = whichPrimarySM2plot
                
                  if LegendModelcounter==1
                        LegOnOff = 'on';
                    else
                        LegOnOff = 'off';
                  end
                    
                groupedindicies=lll:11:numdatapts;
                mymarkersize = SM_MarkerSize(lll) ;
                %plot(eval(sprintf('%s(lll,%g)', TabNames{i}, xvalue)),eval(sprintf('%s(lll,%g)', TabNames{i}, yvalue)),char(layerplot_marker_here(lll)),'Color','k','MarkerFaceColor',layerplot_color_here_fill,'LineWidth',1,'MarkerSize',mymarkersize)
                plot(eval(sprintf('%s_U(groupedindicies)', TabNames{iik})),eval(sprintf('DataRatios_%s(groupedindicies,%g)', ...
                    TabNames{iik}, yyvalue))./TraceElements4Normalization_DataRatios(yyvalue),char(layerplot_marker_here(lll)),...
                    'Color',layerplot_color_here,'MarkerFaceColor',layerplot_color_here_fill,...
                    'LineWidth',SM_LineWidth(lll) ,'MarkerSize',mymarkersize,'handlevisibility',LegOnOff)
                
                LegendModelcounter=LegendModelcounter+1;
            end
            
            accumulatingLegend={accumulatingLegend{:} names4legend_all_sources{iik}};

        else
           

            plot(eval(sprintf('%s_U', TabNames{iik})),eval(sprintf('DataRatios_%s(:,%g)', TabNames{iik}, yyvalue))./TraceElements4Normalization_DataRatios(yyvalue),...
                layerplot_marker_here,...
                'Color',layerplot_color_here,'MarkerFaceColor',layerplot_color_here_fill,...
                'MarkerEdgeColor',layerplot_color_here_edge,...
                'LineWidth',layerplot_linewidth(iik)  ,'MarkerSize',mymarkersize,'handlevisibility','on')
            
             accumulatingLegend={accumulatingLegend{:} names4legend_all_sources{iik}}; 
        
        end
        
        
         
    end
    
    

    
    if n == 1
        axis([0 10 .8 1.8])
        ylabel(sprintf('%s_{%s}',RatioLabels{1}, normalizationLabel));
    end
    
    
        if n==2
            hleg=legend(accumulatingLegend,'autoupdate','off');
            set(hleg,'FontSize',9)
        end
          
    
    
    set(gca, 'Xtick',[.5 1 2 3 4 6 8 10])
    
    if logon ==1
        set(gca,'yscale','log')
        set(gca,'xscale','log')
    end
    
    uistack(h2,'bottom')
    uistack(h1,'bottom')
    
end


subaxis(1,2,1)
hold on
%axis([0 10 .8 1.4])
axis([0 10 .2 3])
set(gca,'xscale','log')
set(gca,'Ytick',[.2 .5 1 2 3])
xline(15/2/10,'-k','ultraslow-slow');
xline(40/2/10,'-k','slow-inter');
xline(120/2/10,'-k','inter-fast');

subaxis(1,2,2)
hold on
%axis([0 10 1 4])
axis([0 10 .5 14])
set(gca,'xscale','log')
xline(15/2/10,'-k','ultraslow-slow');
xline(40/2/10,'-k','slow-inter');
xline(120/2/10,'-k','inter-fast');


for kk=1:numrows.*numcolumns
    subaxis(numrows,numcolumns,kk)
    hold on
    ax=gca;
    set(gca,'ticklength',2.5*[0.0200    0.0500])
    set(gca,'fontsize', 18,'LineWidth',0.7,'FontName','Times New Roman')
    set(gca,'yscale','log')
    ax.YAxis.MinorTick = 'on';
    ax.YAxis.MinorTickValues = [0.001:0.001:.01 .02:.01:.1 .2:.1:1 2:1:10 20:10:100];
    curtick = get(gca, 'XTick');
    set(gca, 'XTickLabel', cellstr(num2str(curtick(:))));
    curtick = get(gca, 'YTick');
    set(gca, 'YTickLabel', cellstr(num2str(curtick(:))));
    set(gca,'XColor', 'k')
    set(gca,'YColor', 'k')
end






%%
figure(61)
close
figure(61)
hold on
FigureTitle = 'SpreadingRate-Useries';
set(gcf,'name',regexprep(FigureTitle,'\_*',''))
set(gcf,'name',FigureTitle)


hold on

numrows=1;
numcolumns=2;

[a,xxxvalue]=ismember('Lnexp_cumulative',ConstraintOptions);
[a,SMvalue]=ismember('FN or FP',ConstraintOptions);
[a,CrustalThickessIndex]=ismember('ct2_ininc(1)',ConstraintOptions);


set(gcf, 'Units', 'Inches', 'Position', [7.1667 6.6528 10.9722 6.3194],  'PaperSize', [8.5, 11])
hold on


for n = 1:numrows.*numcolumns
    subaxis(numrows,numcolumns,n,'Spacing',.08,'Margin',0.02,'MarginBottom',.06,'MarginLeft',.08,'Padding',0,'PaddingLeft',0.02)
    %axis(axesMinors(n,:))
    hold on
    axis square
    accumulatingLegend={}; 

    xlabel(sprintf('Half-spreading rate (cm/yr)'));
    ylabel('(^{230}Th/^{238}U)');
    
    
    
    for iik=1:numberModels
        
        layerplot_color_here = eval(char(layerplot_color(iik)));
        layerplot_color_here_fill = eval(char(layerplot_color_fill(iik)));
        layerplot_color_here_edge = eval(char(layerplot_color_edge(iik)));
        mymarkersize = layerplot_markersize(iik);
        layerplot_marker_here = char(layerplot_marker(iik));
        
        
        
        if any((strfind(TabNames{iik},'SM')))==1
            LegendModelcounter=1; 
            numdatapts = size(eval(sprintf('DataRatios_%s(:,%g)', TabNames{iik}, 1)),1);
            layerplot_marker_here = SM_Markers;
            mymarkersizeSpecial = 3;
            
            for lll =whichPrimarySM2plot
                groupedindicies=lll:11:numdatapts;
                mymarkersize = SM_MarkerSize(lll) ;
                  if LegendModelcounter==1
                         LegOnOff = 'on';
                    else
                        LegOnOff = 'off';
                    end
                
                if n == 1
                    
                    
                    plot(eval(sprintf('%s_U(groupedindicies)', TabNames{iik})),...
                        eval(sprintf('%s_DISEQ(groupedindicies,1)', TabNames{iik})),...
                        char(layerplot_marker_here(lll)),...
                        'Color',layerplot_color_here,'MarkerFaceColor',layerplot_color_here_fill,...
                        'MarkerEdgeColor',layerplot_color_here_edge,...
                        'LineWidth',SM_LineWidth(lll),'MarkerSize',mymarkersize, 'handlevisibility',LegOnOff)
                    
                    title('Zero Ingrowth')
                    
                    
                else
                    plot(eval(sprintf('%s_U(groupedindicies)', TabNames{iik})),...
                        eval(sprintf('%s_DISEQ(groupedindicies,3)', TabNames{iik})),...
                        char(layerplot_marker_here(lll)),...
                        'Color',layerplot_color_here,'MarkerFaceColor',layerplot_color_here_fill,...
                        'MarkerEdgeColor',layerplot_color_here_edge,...
                        'LineWidth',SM_LineWidth(lll),'MarkerSize',mymarkersize, 'handlevisibility',LegOnOff)
                    
                    title('Complete Ingrowth','FontSize',8)
                end
                LegendModelcounter=LegendModelcounter+1;

            end
            accumulatingLegend={accumulatingLegend{:} names4legend_all_sources{iik}}; 
         
        else
           
            
            if n == 1
                plot(eval(sprintf('%s_U(:)', TabNames{iik})),...
                    eval(sprintf('%s_DISEQ(:,1)', TabNames{iik})),...
                    layerplot_marker_here,...
                    'Color',layerplot_color_here,'MarkerFaceColor',layerplot_color_here_fill,...
                    'MarkerEdgeColor',layerplot_color_here_edge,...
                    'LineWidth', layerplot_linewidth(iik) ,'MarkerSize',mymarkersize)
                
            else
                plot(eval(sprintf('%s_U(:)', TabNames{iik})),...
                    eval(sprintf('%s_DISEQ(:,3)', TabNames{iik})),...
                    layerplot_marker_here,...
                    'Color',layerplot_color_here,'MarkerFaceColor',layerplot_color_here_fill,...
                    'MarkerEdgeColor',layerplot_color_here_edge,...
                    'LineWidth', layerplot_linewidth(iik) ,'MarkerSize',mymarkersize)
                
            end
            accumulatingLegend={accumulatingLegend{:} names4legend_all_sources{iik}}; 
         
            
            
        end
    end
    
    
            
        
    
    %     if logon ==1
    %         set(gca,'yscale','log')
    %         %set(gca,'xscale','log')
    %     end
    %
end



hold on
subaxis(1,2,1)
hold on
axis([0 10 0 2])
ax = gca;
set(gca, 'Xtick',[0:1:10])
set(gca,'Ytick',[0:.2:2])
ax.XAxis.MinorTick = 'on';
increment = .5;
ax.XAxis.MinorTickValues = ax.XLim(1):increment:ax.XLim(2);
ax.YAxis.MinorTick = 'on';
increment = findBestIncrement( ax.YLim(2)- ax.YLim(1),ax.YAxis.TickValues(2) -  ax.YAxis.TickValues(1));
ax.YAxis.MinorTickValues = ax.YLim(1):.1:ax.YLim(2);


subaxis(1,2,2)
hold on
axis([0 10 0 2])
set(gca, 'Xtick',[0:1:10])
set(gca,'Ytick',[0:.2:2])
ax = gca;
ax.XAxis.MinorTick = 'on';
increment = .5;
ax.XAxis.MinorTickValues = ax.XLim(1):increment:ax.XLim(2);
ax.YAxis.MinorTick = 'on';
increment = findBestIncrement( ax.YLim(2)- ax.YLim(1),ax.YAxis.TickValues(2) -  ax.YAxis.TickValues(1));
ax.YAxis.MinorTickValues = ax.YLim(1):.1:ax.YLim(2);


for kk=1:numrows.*numcolumns
    subaxis(numrows,numcolumns,kk)
    hold on
    ax=gca;
    set(gca,'ticklength',1.5*[0.0300    0.0500])
    set(gca,'fontsize', 18,'LineWidth',.7,'FontName','Times New Roman')
    %     ax.YAxis.MinorTick = 'on';
    %     ax.YAxis.MinorTickValues = [0.001:0.001:.01 .02:.01:.1 .2:.1:1 2:1:10 20:10:100];
    curtick = get(gca, 'XTick');
    set(gca, 'XTickLabel', cellstr(num2str(curtick(:))));
    curtick = get(gca, 'YTick');
    set(gca, 'YTickLabel', cellstr(num2str(curtick(:))));
    set(gca,'XColor', 'k')
    set(gca,'YColor', 'k')
end

    
            hleg=legend(accumulatingLegend,'autoupdate','off','location','best');
            set(hleg,'FontSize',12)
     
          
 %%
figure(63)
close
figure(63)
hold on
numrows=1;
numcolumns=2;
FigureTitle = '2Panel_Depth';
set(gcf,'name',regexprep(FigureTitle,'\_*','-'))

set(gcf, 'Units', 'Inches', 'Position', [7.1667 6.6528 10.9722 6.3194],  'PaperSize', [8.5, 11])
hold on
masterratios = {'Th/U' 'Sm/Yb'};
for n = 1:numrows.*numcolumns
    subaxis(numrows,numcolumns,n,'Spacing',.08,'Margin',0.02,'MarginBottom',.06,'MarginLeft',.08,'Padding',0,'PaddingLeft',0.02)
    %axis(axesMinors(n,:))
    hold on
    axis square
    box on
    accumulatingLegend={}; 
    

    
        Desired_Y=masterratios{n};
    [b,yyvalue] = ismember(Desired_Y,RatioLabels);
 
    
    xlabel(sprintf('Depth (m)'));
    ylabel(sprintf('%s_{%s}',Desired_Y, normalizationLabel));
    
    
   h1=plot(Galeetal2013_MajorTrace_DEPTH,...
       Galeetal2013_MajorTrace_DataRatios(:,yyvalue)./TraceElements4Normalization_DataRatios(yyvalue)...
        ,'o','Color',grey8,'LineWidth',0.1,'MarkerSize',5,'MarkerFaceColor',grey8);
    
    h2=plot(Galeetal2013_MajorTrace_DEPTH(emorbs1),Galeetal2013_MajorTrace_DataRatios(emorbs1,yyvalue)./TraceElements4Normalization_DataRatios(yyvalue)...
        ,'o','Color',grey5,'LineWidth',0.1,'MarkerSize',5,'MarkerFaceColor',grey5);
    
    accumulatingLegend={accumulatingLegend{:} 'all MORB' 'E-MORB'};
     
    
%     for iik=1:numberModels
%         
%         layerplot_color_here = eval(char(layerplot_color(iik)));
%         layerplot_color_here_fill = eval(char(layerplot_color_fill(iik)));
%         layerplot_color_here_edge = eval(char(layerplot_color_edge(iik)));
%         mymarkersize = layerplot_markersize(iik);
%         layerplot_marker_here = char(layerplot_marker(iik));
%         
%         
%         
%         if any((strfind(TabNames{iik},'SM')))==1
%             
%             LegendModelcounter=1; 
%             
%             numdatapts = size(eval(sprintf('DataRatios_%s(:,%g)', TabNames{iik}, yyvalue)),1);
%             layerplot_marker_here = SM_Markers;
%             %layerplot_ marker_here = layerplot_marker;
%             mymarkersizeSpecial = 3;%mymarkersize;       %specialMarkersSizes;
%             
%             for lll = whichPrimarySM2plot
%                 
%                   if LegendModelcounter==1
%                         LegOnOff = 'on';
%                     else
%                         LegOnOff = 'off';
%                   end
%                     
%                 groupedindicies=lll:11:numdatapts;
%                 mymarkersize = SM_MarkerSize(lll) ;
%                 %plot(eval(sprintf('%s(lll,%g)', TabNames{i}, xvalue)),eval(sprintf('%s(lll,%g)', TabNames{i}, yvalue)),char(layerplot_marker_here(lll)),'Color','k','MarkerFaceColor',layerplot_color_here_fill,'LineWidth',1,'MarkerSize',mymarkersize)
%                 plot(eval(sprintf('%s_U(groupedindicies)', TabNames{iik})),eval(sprintf('DataRatios_%s(groupedindicies,%g)', ...
%                     TabNames{iik}, yyvalue))./TraceElements4Normalization_DataRatios(yyvalue),char(layerplot_marker_here(lll)),...
%                     'Color',layerplot_color_here,'MarkerFaceColor',layerplot_color_here_fill,...
%                     'LineWidth',SM_LineWidth(lll) ,'MarkerSize',mymarkersize,'handlevisibility',LegOnOff)
%                 
%                 LegendModelcounter=LegendModelcounter+1;
%             end
%             
%             accumulatingLegend={accumulatingLegend{:} names4legend_all_sources{iik}};
% 
%         else
%            
% 
%             plot(eval(sprintf('%s_U', TabNames{iik})),eval(sprintf('DataRatios_%s(:,%g)', TabNames{iik}, yyvalue))./TraceElements4Normalization_DataRatios(yyvalue),...
%                 layerplot_marker_here,...
%                 'Color',layerplot_color_here,'MarkerFaceColor',layerplot_color_here_fill,...
%                 'MarkerEdgeColor',layerplot_color_here_edge,...
%                 'LineWidth',layerplot_linewidth(iik)  ,'MarkerSize',mymarkersize,'handlevisibility','on')
%             
%              accumulatingLegend={accumulatingLegend{:} names4legend_all_sources{iik}}; 
%         
%         end
%         
%         
%          
%     end
%     
    

    
    if n == 1
        %axis([0 10 .8 1.8])
        ylabel(sprintf('%s_{%s}',RatioLabels{1}, normalizationLabel));
    end
    
    
        if n==2
            hleg=legend(accumulatingLegend,'autoupdate','off');
            set(hleg,'FontSize',9)
        end
          
    
    
   
%     
%     if logon ==1
%         set(gca,'yscale','log')
%         set(gca,'xscale','log')
%     end
    
    uistack(h2,'bottom')
    uistack(h1,'bottom')
    
end


% subaxis(1,2,1)
% hold on
% %axis([0 10 .8 1.4])
% axis([0 10 .2 3])
% set(gca,'xscale','log')
% set(gca,'Ytick',[.2 .5 1 2 3])
% xline(15/2/10,'-k','ultraslow-slow');
% xline(40/2/10,'-k','slow-inter');
% xline(120/2/10,'-k','inter-fast');
% 
% subaxis(1,2,2)
% hold on
% %axis([0 10 1 4])
% axis([0 10 .5 14])
% set(gca,'xscale','log')
% xline(15/2/10,'-k','ultraslow-slow');
% xline(40/2/10,'-k','slow-inter');
% xline(120/2/10,'-k','inter-fast');


for kk=1:numrows.*numcolumns
    subaxis(numrows,numcolumns,kk)
    hold on
    ax=gca;
    set(gca,'ticklength',2.5*[0.0200    0.0500])
    set(gca,'fontsize', 18,'LineWidth',0.7,'FontName','Times New Roman')
    set(gca,'yscale','log')
    ax.YAxis.MinorTick = 'on';
    ax.YAxis.MinorTickValues = [0.001:0.001:.01 .02:.01:.1 .2:.1:1 2:1:10 20:10:100];
    
    curtick = get(gca, 'XTick');
    set(gca, 'XTickLabel', cellstr(num2str(curtick(:))));
    curtick = get(gca, 'YTick');
    set(gca, 'YTickLabel', cellstr(num2str(curtick(:))));
    set(gca,'XColor', 'k')
    set(gca,'YColor', 'k')
end
%%

figure(64)
close
figure(64)
hold on
numrows=1;
numcolumns=1;
FigureTitle = '2Panel_Depth';
set(gcf,'name',regexprep(FigureTitle,'\_*','-'))

set(gcf, 'Units', 'Inches', 'Position', [7.1667 6.0694 7.5000 6.9028],  'PaperSize', [8.5, 11])
hold on
masterratios = {'Th/U' 'Sm/Yb'};
for n = 1:numrows.*numcolumns
    subaxis(numrows,numcolumns,n,'Spacing',.08,'Margin',0.02,'MarginBottom',.06,'MarginLeft',.08,'Padding',0.05,'PaddingLeft',0.02)
    %axis(axesMinors(n,:))
    hold on
    axis square
    box on
    accumulatingLegend={}; 
    

    
    Desired_Y=masterratios{n};
    [b,yyvalue] = ismember(Desired_Y,RatioLabels);
 
    
    ylabel(sprintf('Depth (m)'));
    xlabel(sprintf('Spreading Rate (cm/yr)'));
    
    
   h1=plot(Galeetal2013_MajorTrace_SPREADINGRATE./20,...
       Galeetal2013_MajorTrace_DEPTH,...
        'o','Color',grey8,'LineWidth',0.1,'MarkerSize',5,'MarkerFaceColor',grey8);
    
    h2=plot(Galeetal2013_MajorTrace_SPREADINGRATE(emorbs1)./20,...
        Galeetal2013_MajorTrace_DEPTH(emorbs1),...
        'o','Color',grey5,'LineWidth',0.1,'MarkerSize',5,'MarkerFaceColor',grey5);
    
    accumulatingLegend={accumulatingLegend{:} 'all MORB' 'E-MORB'};
     
    
        if n==1
            hleg=legend(accumulatingLegend,'autoupdate','off');
            set(hleg,'FontSize',12)
        end
          
    
   
    
end


% subaxis(1,2,1)
% hold on
% %axis([0 10 .8 1.4])
% axis([0 10 .2 3])
% set(gca,'xscale','log')
% set(gca,'Ytick',[.2 .5 1 2 3])
% xline(15/2/10,'-k','ultraslow-slow');
% xline(40/2/10,'-k','slow-inter');
% xline(120/2/10,'-k','inter-fast');
% 
% subaxis(1,2,2)
% hold on
% %axis([0 10 1 4])
% axis([0 10 .5 14])
% set(gca,'xscale','log')
% xline(15/2/10,'-k','ultraslow-slow');
% xline(40/2/10,'-k','slow-inter');
% xline(120/2/10,'-k','inter-fast');


for kk=1:numrows.*numcolumns
    subaxis(numrows,numcolumns,kk)
    hold on
    ax=gca;
    set(gca,'ticklength',2.5*[0.0200    0.0500])
    set(gca,'fontsize', 18,'LineWidth',0.7,'FontName','Times New Roman')
   % set(gca,'yscale','log')
    ax.YAxis.MinorTick = 'on';
   % ax.YAxis.MinorTickValues = [0.001:0.001:.01 .02:.01:.1 .2:.1:1 2:1:10 20:10:100];
    
    curtick = get(gca, 'XTick');
    set(gca, 'XTickLabel', cellstr(num2str(curtick(:))));
    curtick = get(gca, 'YTick');
    set(gca, 'YTickLabel', cellstr(num2str(curtick(:))));
    set(gca,'XColor', 'k')
    set(gca,'YColor', 'k')
end

%%
figure(65)
close
figure(65)
hold on
FigureTitle = 'SourceWater-Zeta';
set(gcf,'name',regexprep(FigureTitle,'\_*',''))
set(gcf,'name',FigureTitle)


hold on

numrows=1;
numcolumns=1;


set(gcf, 'Units', 'Inches', 'Position',[7.1667 6.0694 7.4027 6.9028],  'PaperSize', [8.5, 11])
hold on


for n = 1:numrows.*numcolumns
    subaxis(numrows,numcolumns,n,'Spacing',.08,'Margin',0.02,'MarginBottom',.06,'MarginLeft',.08,'Padding',0.05,'PaddingLeft',0.02)
    %axis(axesMinors(n,:))
    hold on
    axis square
    accumulatingLegend={}; 

    xlabel('Water in Source (ppm)')
    
       ylabel('\zeta (%)')
    
    
    
    for iik=1:numberModels
        
        layerplot_color_here = eval(char(layerplot_color(iik)));
        layerplot_color_here_fill = eval(char(layerplot_color_fill(iik)));
        layerplot_color_here_edge = eval(char(layerplot_color_edge(iik)));
        mymarkersize = layerplot_markersize(iik);
        layerplot_marker_here = char(layerplot_marker(iik));
        
        
        
        if any((strfind(TabNames{iik},'SM')))==1
            LegendModelcounter=1; 
            numdatapts = size(eval(sprintf('DataRatios_%s(:,%g)', TabNames{iik}, 1)),1);
            layerplot_marker_here = SM_Markers;
            mymarkersizeSpecial = 3;
            
            for lll =whichPrimarySM2plot
                groupedindicies=lll:11:numdatapts;
                mymarkersize = SM_MarkerSize(lll) ;
                  if LegendModelcounter==1
                         LegOnOff = 'on';
                    else
                        LegOnOff = 'off';
                    end
                
             
                    plot(eval(sprintf('%s_Water(groupedindicies)', TabNames{iik})),...
                        eval(sprintf('%s_WGP_onaxis(groupedindicies,1)', TabNames{iik})),...
                        char(layerplot_marker_here(lll)),...
                        'Color',layerplot_color_here,'MarkerFaceColor',layerplot_color_here_fill,...
                        'MarkerEdgeColor',layerplot_color_here_edge,...
                        'LineWidth',SM_LineWidth(lll),'MarkerSize',mymarkersize, 'handlevisibility',LegOnOff)
                    
             
                
            
                LegendModelcounter=LegendModelcounter+1;

            end
            accumulatingLegend={accumulatingLegend{:} names4legend_all_sources{iik}}; 
         
        else
           
                plot(eval(sprintf('%s_Water(:)', TabNames{iik})),...
                    eval(sprintf('%s_WGP_onaxis', TabNames{iik})),...
                    layerplot_marker_here,...
                    'Color',layerplot_color_here,'MarkerFaceColor',layerplot_color_here_fill,...
                    'MarkerEdgeColor',layerplot_color_here_edge,...
                    'LineWidth', layerplot_linewidth(iik) ,'MarkerSize',mymarkersize)
                
         
            accumulatingLegend={accumulatingLegend{:} names4legend_all_sources{iik}}; 
         
            
            
        end
    end
    
    
            
        
    
    %     if logon ==1
    %         set(gca,'yscale','log')
    %         %set(gca,'xscale','log')
    %     end
    %
end




for kk=1:numrows.*numcolumns
    subaxis(numrows,numcolumns,kk)
    hold on
    ax=gca;
    set(gca,'ticklength',1.5*[0.0300    0.0500])
    set(gca,'fontsize', 18,'LineWidth',.7,'FontName','Times New Roman')
    %set(gca, 'Xtick',[0:1:10])
   ax.YAxis.MinorTick = 'on';
   if strcmp(ax.XScale,'linear')==1
        ax.XAxis.MinorTick = 'on';
        increment = findBestIncrement( ax.XLim(2)- ax.XLim(1),ax.XAxis.TickValues(2) -  ax.XAxis.TickValues(1));
        
        numIncre = (ax.XAxis.TickValues(2) -  ax.XAxis.TickValues(1))/increment;
        ax.XAxis.MinorTickValues = ax.XAxis.TickValues(1)-numIncre.*increment:increment:ax.XAxis.TickValues(end)+numIncre.*increment;
    else
        
        set(gca, 'Xtick',unique([[0.001 0.01 .1 1 10 100]]))
        
        curtick = get(gca, 'XTick');
        set(gca, 'XTickLabel', cellstr(num2str(curtick(:))));
        
        ax.XAxis.MinorTickValues = [.001:.001:.01 .02:.01:.1 .2:.1:1 2:1:10 20:10:100];
        
        
    end
    
    if strcmp(ax.YScale,'linear')==1
        ax.YAxis.MinorTick = 'on';
        increment = findBestIncrement( ax.YLim(2)- ax.YLim(1),ax.YAxis.TickValues(2) -  ax.YAxis.TickValues(1));
        
        
        numIncre = (ax.YAxis.TickValues(2) -  ax.YAxis.TickValues(1))/increment;
        ax.YAxis.MinorTickValues = ax.YAxis.TickValues(1)-numIncre.*increment:increment:ax.YAxis.TickValues(end)+numIncre.*increment;
    else
        
        set(gca, 'Ytick',unique([[0.001 0.01 .1 1 10 100]]))
        
        curtick = get(gca, 'YTick');
        set(gca, 'YTickLabel', cellstr(num2str(curtick(:))));
        
        ax.YAxis.MinorTickValues = [.001:.001:.01 .02:.01:.1 .2:.1:1 2:1:10 20:10:100];
        
        
    end
    
    curtick = get(gca, 'XTick');
    set(gca, 'XTickLabel', cellstr(num2str(curtick(:))));
    curtick = get(gca, 'YTick');
    set(gca, 'YTickLabel', cellstr(num2str(curtick(:))));
    set(gca,'XColor', 'k')
    set(gca,'YColor', 'k')
end

    
            hleg=legend(accumulatingLegend,'autoupdate','off','location','best');
            set(hleg,'FontSize',12)
            

%%
figure(66)
close
figure(66)
hold on
FigureTitle = 'SpreadingRate-Zeta';
set(gcf,'name',regexprep(FigureTitle,'\_*',''))
set(gcf,'name',FigureTitle)


hold on

numrows=1;
numcolumns=1;



set(gcf, 'Units', 'Inches', 'Position',[7.1667 6.0694 7.4027 6.9028],  'PaperSize', [8.5, 11])
hold on


for n = 1:numrows.*numcolumns
    subaxis(numrows,numcolumns,n,'Spacing',.08,'Margin',0.02,'MarginBottom',.06,'MarginLeft',.08,'Padding',0.05,'PaddingLeft',0.02)
    %axis(axesMinors(n,:))
    hold on
    axis square
    accumulatingLegend={}; 

    xlabel(sprintf('Half-spreading rate (cm/yr)'));
       ylabel('\zeta (%)')
    
    
    
    for iik=1:numberModels
        
        layerplot_color_here = eval(char(layerplot_color(iik)));
        layerplot_color_here_fill = eval(char(layerplot_color_fill(iik)));
        layerplot_color_here_edge = eval(char(layerplot_color_edge(iik)));
        mymarkersize = layerplot_markersize(iik);
        layerplot_marker_here = char(layerplot_marker(iik));
        
        
        
        if any((strfind(TabNames{iik},'SM')))==1
            LegendModelcounter=1; 
            numdatapts = size(eval(sprintf('DataRatios_%s(:,%g)', TabNames{iik}, 1)),1);
            layerplot_marker_here = SM_Markers;
            mymarkersizeSpecial = 3;
            
            for lll =whichPrimarySM2plot
                groupedindicies=lll:11:numdatapts;
                mymarkersize = SM_MarkerSize(lll) ;
                  if LegendModelcounter==1
                         LegOnOff = 'on';
                    else
                        LegOnOff = 'off';
                    end
                
             
                    plot(eval(sprintf('%s_U(groupedindicies)', TabNames{iik})),...
                        eval(sprintf('%s_WGP_onaxis(groupedindicies,1)', TabNames{iik})),...
                        char(layerplot_marker_here(lll)),...
                        'Color',layerplot_color_here,'MarkerFaceColor',layerplot_color_here_fill,...
                        'MarkerEdgeColor',layerplot_color_here_edge,...
                        'LineWidth',SM_LineWidth(lll),'MarkerSize',mymarkersize, 'handlevisibility',LegOnOff)
                    
             
                
            
                LegendModelcounter=LegendModelcounter+1;

            end
            accumulatingLegend={accumulatingLegend{:} names4legend_all_sources{iik}}; 
         
        else
           
                plot(eval(sprintf('%s_U(:)', TabNames{iik})),...
                    eval(sprintf('%s_WGP_onaxis', TabNames{iik})),...
                    layerplot_marker_here,...
                    'Color',layerplot_color_here,'MarkerFaceColor',layerplot_color_here_fill,...
                    'MarkerEdgeColor',layerplot_color_here_edge,...
                    'LineWidth', layerplot_linewidth(iik) ,'MarkerSize',mymarkersize)
                
         
            accumulatingLegend={accumulatingLegend{:} names4legend_all_sources{iik}}; 
         
            
            
        end
    end
    
    
            
        
    
    %     if logon ==1
    %         set(gca,'yscale','log')
    %         %set(gca,'xscale','log')
    %     end
    %
end




for kk=1:numrows.*numcolumns
    subaxis(numrows,numcolumns,kk)
    hold on
    ax=gca;
    set(gca,'ticklength',1.5*[0.0300    0.0500])
    set(gca,'fontsize', 18,'LineWidth',.7,'FontName','Times New Roman')
    set(gca, 'Xtick',[0:1:10])
   ax.YAxis.MinorTick = 'on';
   if strcmp(ax.XScale,'linear')==1
        ax.XAxis.MinorTick = 'on';
        increment = findBestIncrement( ax.XLim(2)- ax.XLim(1),ax.XAxis.TickValues(2) -  ax.XAxis.TickValues(1));
        
        numIncre = (ax.XAxis.TickValues(2) -  ax.XAxis.TickValues(1))/increment;
        ax.XAxis.MinorTickValues = ax.XAxis.TickValues(1)-numIncre.*increment:increment:ax.XAxis.TickValues(end)+numIncre.*increment;
    else
        
        set(gca, 'Xtick',unique([[0.001 0.01 .1 1 10 100]]))
        
        curtick = get(gca, 'XTick');
        set(gca, 'XTickLabel', cellstr(num2str(curtick(:))));
        
        ax.XAxis.MinorTickValues = [.001:.001:.01 .02:.01:.1 .2:.1:1 2:1:10 20:10:100];
        
        
    end
    
    if strcmp(ax.YScale,'linear')==1
        ax.YAxis.MinorTick = 'on';
        increment = findBestIncrement( ax.YLim(2)- ax.YLim(1),ax.YAxis.TickValues(2) -  ax.YAxis.TickValues(1));
        
        
        numIncre = (ax.YAxis.TickValues(2) -  ax.YAxis.TickValues(1))/increment;
        ax.YAxis.MinorTickValues = ax.YAxis.TickValues(1)-numIncre.*increment:increment:ax.YAxis.TickValues(end)+numIncre.*increment;
    else
        
        set(gca, 'Ytick',unique([[0.001 0.01 .1 1 10 100]]))
        
        curtick = get(gca, 'YTick');
        set(gca, 'YTickLabel', cellstr(num2str(curtick(:))));
        
        ax.YAxis.MinorTickValues = [.001:.001:.01 .02:.01:.1 .2:.1:1 2:1:10 20:10:100];
        
        
    end
    
    curtick = get(gca, 'XTick');
    set(gca, 'XTickLabel', cellstr(num2str(curtick(:))));
    curtick = get(gca, 'YTick');
    set(gca, 'YTickLabel', cellstr(num2str(curtick(:))));
    set(gca,'XColor', 'k')
    set(gca,'YColor', 'k')
end

    
            hleg=legend(accumulatingLegend,'autoupdate','off','location','best');
            set(hleg,'FontSize',12)
            
            
            

    
    

return